package com.hejielife.reflection;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Test007 {

	public static void main(String[] args)
			throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException,
			SecurityException, IllegalArgumentException, InvocationTargetException {
		Class<?> forName = Class.forName("com.itmayiedu.Singleton.SingletonDemo04");
		Constructor<?> declaredConstructor = forName.getDeclaredConstructor(null);
		// 标记为true 允许反射赋值
		declaredConstructor.setAccessible(true);
		Object s1 = declaredConstructor.newInstance();
		System.out.println(s1);
	}

}
